package com.wwu.system.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wwu.common.constant.CommConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 在线聊天实体类
 * @author 一蓑烟雨
 * @date  2022-05-13 22:23
 * @version  1.0.0
 **/
@Data
@Accessors(chain = true)
@ApiModel(value="ChatMsg:在线聊天实体", description="在线聊天实体")
public class ChatMsg implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "消息发送者")
    private String msgFrom;

    @ApiModelProperty(value = "消息接收者")
    private String msgTo;

    @ApiModelProperty(value = "消息内容")
    private String msgContent;

    @ApiModelProperty(value = "消息发送者昵称")
    private String fromNickName;

    @ApiModelProperty(value = "消息发送时间")
    /** 格式化后台和前端显示样式 */
    @DateTimeFormat(pattern = CommConst.DATE_TIME)
    @JsonFormat(pattern = CommConst.DATE_TIME,timezone = CommConst.TIME_ZONE)
    private LocalDateTime msgDate;
}